/**
 * @param {string} num1
 * @param {string} num2
 * @return {string}
 */
var addStrings = function (num1, num2) {
    // 从最后一位开始，相加，记得进位
    let i = num1.length - 1, j = num2.length - 1
    let rslt = ''
    let m = 0
    while (i >= 0 || j >= 0 || m > 0) {
        let temp = Number(num1[i] || 0) + Number(num2[j] || 0) + m
        m = Math.floor(temp / 10)
        temp = m > 0 ? temp - 10 : temp
        rslt = temp + rslt
        i--
        j--
    }
    return rslt
};


console.log(addStrings('1800', '420'))